﻿@model Pitstop.WebApp.ViewModels.WorkshopManagementNewViewModel
@{
    ViewData["Title"] = "Schedule Maintenance";
}

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); }
}

<h3 id="PageTitle">Workshop Management - schedule maintenance</h3>

@if (!string.IsNullOrEmpty(Model.Error))
{
    <div class="well-sm alert-danger">
        <label>Unable to register: @Model.Error</label>
    </div>
}


<form asp-controller="WorkshopManagement" asp-action="RegisterMaintenanceJob" method="post">
    <div class="form-group">
        <label asp-for="StartTime"></label>
        <input asp-for="StartTime" type="text" class="form-control" />
        <span asp-validation-for="StartTime" class="text-danger"></span>
    </div>
    <div class="form-group">
        <label asp-for="EndTime"></label>
        <input asp-for="EndTime" type="text" class="form-control" />
        <span asp-validation-for="EndTime" class="text-danger"></span>
    </div>
    <div class="form-group">
        <label asp-for="Description"></label>
        <input asp-for="Description" type="text" class="form-control" />
        <span asp-validation-for="Description" class="text-danger"></span>
    </div>
    <div class="form-group">
        <label asp-for="SelectedVehicleLicenseNumber"></label>
        <select asp-for="SelectedVehicleLicenseNumber" asp-items="Model.Vehicles" class="form-control"></select>
        <span asp-validation-for="SelectedVehicleLicenseNumber" class="text-danger"></span>
    </div>
    <input asp-for="Date" type="hidden" />
    <span><button id="SubmitButton" type="submit" class="btn btn-default">Register</button></span>
    <span><a id="CancelButton" asp-action="Index" asp-route-planningDate="@Model.Date.ToString("yyyy-MM-dd")" asp-controller="WorkshopManagement" class="btn btn-default">Cancel</a></span>
</form>


